package com.freecloud.common;

/**
 * @Author: maomao
 * @Date: 2019-11-19 10:03
 */
public class LoggerUtil {
    /**
     * 打印线程
     */
    public static void printThread(){
        System.out.println( String.format("当前线程：[ %s ]",Thread.currentThread().getName()));
    }

    public static void printThread(String message){
        System.out.println(String.format("当前线程：[ %s ] : %s",Thread.currentThread().getName(),message));
    }

    /**
     * 使用String.format输出日志
     * @param strFormat
     * @param args
     */
    public static void println(String strFormat,Object... args){
        System.out.println(String.format(strFormat,args));
    }

    public static void println(Object obj){
        println(obj.toString(),null);
    }

    public static void println(Object obj,boolean isPrintSplit){
        println(obj.toString(),null);
        if(isPrintSplit){
            split();
        }
    }

    public static void split(){
        println("-------------------华丽的分割线-----------------",null);
        System.out.println("\r\n");
    }
}
